package com.godofgamblers.hotelmanagementsystem.mapper;

import com.godofgamblers.hotelmanagementsystem.pojo.Discount_Store;
import com.godofgamblers.hotelmanagementsystem.pojo.Room_Type;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @Author: 伴你时光尽头
 * @Date: 2019/10/15 12:11
 */
@Repository
public interface Discount_StoreMapper {
    /**
     * 插入：
     * 用于存储全场折扣操作前 room_type的折扣信息
     *
     * @param discount_store discount_store POJo类
     */
    @Insert("insert into discount_store(room_type_id,discount_store_discount) values(#{room_type_id},#{discount_store_discount}) ")
    public void insertItem(Discount_Store discount_store);

    /**
     * 查询：
     * 查询discount_store中所有的数据并以Discount_Store类型集合返回数据
     * @return  List<Discount_Store>
     */
    @Select("select * from discount_store")
    public List<Discount_Store> showAllItem();

    /**
     *
     */
    @Delete("truncate table discount_store")
    public void deleteAllItem();
}
